/***************************************************************************
创建者：华磊
 开始时间：               : 2020.11.29
 copyright            : (C) 深圳市华友高科有限公司
 修改说明：（每次有修改就添加一条，带有 修改人，修改时间，修改描述）

 ***************************************************************************
 *   主菜单窗口程序
*                                                                         *
 ***************************************************************************/
#ifndef HOMEMENUVIEW_H
#define HOMEMENUVIEW_H


#include <QWidget>
#include <QMenu>
#include <QAction>
#include <QMenuBar>
#include <QStatusBar>
#include <QPoint>
#include <QTranslator>


#include "manualservondialog.h"
#include "setzeropointdialog.h"
#include "touchcheckdialog.h"
#include "passwordmodiydialog.h"
#include "motorstatusview.h"
#include "registrationdialog.h"
#include "devicelogdialog.h"
#include "setcoordinatedialog.h"
#include "copyrightdialog.h"
#include "companyinfodialog.h"
#include "ipsettingdialog.h"
#include "starttypedialog.h"
#include "../login1/login.h"
#include "../VrepConfigView/vrepconfigview.h"
#include "ethercatdeviceconfigdlg.h"
#include "debuginformationdlg.h"


class CommunicateNormalDelegate;
class WeldPropertyDialog;
class WeldConditionDialog;
class WeldSystemDialog;
class UpgradeHmiExeDlg ;
class RestoreAndBackupDlg ;
class FileBackUpDialog ;
class FileRestoreDialog ;
class RestoreDialog ;
class RestoreCheckDialog ;
class WeaveMotionConditionDialog;
class PalletParameterSettingView;
class MoveOperation;

namespace Ui {
class HomeMenuView;
}

/**
 * @brief The HomeMenuView class　主菜单界面类
 */
class  HomeMenuView : public QWidget
{
    Q_OBJECT

public:
    explicit HomeMenuView(int styleId, CommunicateNormalDelegate* communicateNormalIn, GlobalData *globalDataIn,
                          Login *loginDialogIn, MoveOperation *moveOperationIn,  QWidget *parent = 0);
    ~HomeMenuView();

    void setViewText();

    void changeLanguage(int languageMenu);
    void showLoginView();
    void initialDisplayStyle(int styleId);

signals:
    void setMaxJogTime_signal(int timeIn);
    /**
     * @brief menuSignal    文件菜单信号函数
     * @param point　坐标点
     */
    void menuSignal(const QPoint &menuShowPoint);
    /**
     * @brief roleSignal    角色菜单信号函数
     * @param point1　坐标点
     */
    void roleSignal(const QPoint &point1);
    /**
     * @brief runSignal     运行配置菜单信号函数
     * @param point2　坐标点
     */
    void runSignal(const QPoint &point2);
    /**
     * @brief moniterSignal 监视器菜单信号函数
     * @param point3　坐标点
     */
    void moniterSignal(const QPoint &point3);
    /**
     * @brief logSignal     日志菜单信号函数
     * @param point4　坐标点
     */
    void logSignal(const QPoint &point4);
    /**
     * @brief shutdownSignal    关机菜单信号函数
     * @param point5　坐标点
     */
    void shutdownSignal(const QPoint &point5);
    /**
     * @brief helpSignal    帮助菜单信号函数
     * @param point6　坐标点
     */
    void helpSignal(const QPoint &point6);
    /**
     * @brief advanceSignal 高级菜单信号含糊示
     * @param point7　坐标点
     */
    void advanceSignal(const QPoint &point7);


    void servonBtnSignals(int onOff);
    void showAgvSetParaDiagSignal();
//    void menuCraft_signal();

private slots:
    void showMenu(const QPoint &menuShowPoint);
    void showRole(const QPoint &point1);
    void showRun(const QPoint &point2);
    void showMoniter(const QPoint &point3);
    void showLog(const QPoint &point4);
    void showShutdown(const QPoint &point5);
    void showHelp(const QPoint &point6);
    void showAdvance(const QPoint &point7);

    void on_file_clicked();
    void on_role_clicked();
    void on_run_clicked();
    void on_moniter_clicked();
    void on_log_clicked();
    void on_shutdown_clicked();
    void on_help_clicked();
    void on_advance_clicked();

    void on_pushButton_exitProgram_clicked();

    void on_pushButton_agvSetPara_clicked();

    void on_pushButton_craft_clicked();


public:
    //子页面
    DebugInformationDlg *debugInfoDlg;
    EthercatDeviceConfigDlg *ethercatDevicefigDlg;
    UpgradeHmiExeDlg *upgradeHmiDlg;
    RestoreAndBackupDlg *restoreAndBackDlg;
    FileBackUpDialog *fileBackUpDialog;
    FileRestoreDialog *fileRestoreDialog;

    ManualServonDialog *manualServonDialog;

    SetZeroPointDialog *setZeroPointDialog;

    TouchCheckDialog *touchCheckDialog;

    PasswordModiyDialog *passwordModiyDialog;

    MotorStatusView *motorStatusView;

    RegistrationDialog *registrationDialog;

    RestoreDialog *restoreDialog;
    RestoreCheckDialog *restoreCheckDialog;

    DeviceLogDialog *deviceLogDialog;

    SetCoordinateDialog *setcoordinatedialog;
    SetCoordinate2Dialog *coordinate2Dialog;

    CopyRightDialog *copyRightDialog;

    CompanyInfoDialog *companyInfoDialog;



    IpSettingDialog *ipSettingDialog;

    StartTypeDialog *startTypeDialog;

    VrepConfigView* vrepConfigView;

    WeldPropertyDialog *weldPropertyDialog;
    WeldConditionDialog *weldConditionDialog;
    WeldSystemDialog *weldSystemDialog;
    WeaveMotionConditionDialog *weaveConditionDialog;
    PalletParameterSettingView *palletSetDialog;

public:
    QString styleMenu;

    QMenu* craftMenu;

    /**
     * @brief menu      文件菜单
     */
    QMenu* fileMenu;
    /**
     * @brief role      角色菜单
     */
    QMenu* roleMenu;
    /**
     * @brief run       运行配置菜单
     */
    QMenu* runConfigMenu;
    /**
     * @brief moniter   监视器菜单
     */
    QMenu* moniterMenu;
    /**
     * @brief log       日志菜单
     */
    QMenu* logMenu;
    /**
     * @brief shutdown  关机菜单
     */
    QMenu* shutdownMenu;
    /**
     * @brief help      帮助菜单
     */
    QMenu* helpMenu;
    /**
     * @brief advance   高级菜单
     */
    QMenu* advanceMenu;
    /**
     * @brief advance   菜单
     */
    QMenu* languageMenu;

    /**
     * @brief act       次级菜单
     */
    QAction* fileAction[5];
    QAction* roleAction[2];
    QAction* runConfigAction[11];
    QAction* monitorAction[3];
    QAction* logAction[1];
    QAction* shutdownAction[1];
    QAction* helpAction[5];
    QAction* advanceAction[6];
    QAction* languageAction[2];//language

    QAction* action_craft[10];

    /**
     * @brief point     窗体坐标点
     */
    QPoint menuShowPoint;
    QPoint point1;
    QPoint point2;
    QPoint point3;
    QPoint point4;
    QPoint point5;
    QPoint point6;
    QPoint point7;

private:
    QTranslator translator;
    Login *loginDialog;


private:
    Ui::HomeMenuView *ui;
};

#endif // HOMEMENUVIEW_H
